<script>

<?php 
$req =$bdd->query("SELECT nom, latitude , longitude  FROM event ");
?>
var events = [];
<?php
while ($donnees= $req->fetch()) {
?>
    var event = {};
    event['nom'] = '<?php echo $donnees['nom']; ?>';
    event['latitude'] = '<?php echo $donnees['latitude']; ?>';	 
    event['longitude'] = '<?php echo $donnees['longitude']; ?>';
    events.push(event);
<?php 
}
?>



</script>
